home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine CD 1995
/
Archive Magazine CD 1995.iso
/
discs
/
pipeline
/
abacus
/
p_line
/
Vlookup01
/
ReadMe
next >
Wrap
Text File
|
1993-10-16
|
2KB
|
49 lines
%OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938
%OP%DP0
%OP%IRY
%OP%PL0
%OP%HM0
%OP%FM0
%OP%BM0
%OP%LM4
%OP%PT1
%OP%PDPipeLine
%OP%WC1026,2262,188,1748,0,0,0,0
%CO:A,72,72%
%C%The vlookup(,,) Function
%C%by Gerald L Fitton
Keywords:
Vlookup Fitton
First, let us see how it works. Load the file [TestFile], click on the
cell B5 and you will see that it contains the number 50. This is
between the 40 Pass mark (in cell B10) and the 60 needed for a Merit.
The formula in C5 is vlookup(B5,B8B13,1) which, in this case, returns
the string Pass from slot C10.
Try a few other numbers (preferably between 0 and 100) and you will
find that, if you don't have an exact match, then the next lower mark
determines the grade awarded. For vlookup(key,range1,offset) to work
correctly it is essential that range1 (in this case B8B13) is sorted in
ascending order - ignore this at your peril!
The offset is the third argument of the function. You decide on the
offset you need by counting the column containing range1 as a zero
offset and counting to the right. The formula in cell C5 refers to an
offset of 1 and that in D5 an offset of 2.
Experiment by changing the offset in either C5 or D5 to any number
between 0 and 2 inclusive. I suggest that you spend a little time
thinking of applications for an offset of 0 - I think it could be
useful for tricky rounding down problems!
The range, range1, is a single column; you can not include an array.
Finally, all the lookup functions have a different syntax in Resultz so
that, if you 'port' an application (such as this) containing
vlookup(,,) to Resultz then you will get an error message! The
function corresponding to vlookup(B5,B8B13,2) in Resultz is
vlookup(B5,B8D13,3) - both the range and offset have changed!
Any volunteers for a similar article about lookup(,,)?